package com.kristin.rmi;

import com.kristin.rmi.service.DemoService;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * @ClassName Client
 * @Description TODO
 * @Author Kristin
 * @Date 2021/06/23 13:31:56
 * @Version 1.0.0
 */
public class Client {

    public static void main(String[] args) throws RemoteException, NotBoundException, MalformedURLException {
        DemoService remote = (DemoService)Naming.lookup("rmi://localhost:8888/DemoService");
        String s = remote.hello("kristin");
        System.out.println(s);
    }

}
